package com.maelarak.android.lolcharbuilder.models;

import android.graphics.Picture;

import com.maelarak.android.lolcharbuilder.config.SoftwareProperties;

import java.io.File;
import java.util.ArrayList;

/**
 * LolCharBuilder
 * Created by MaelArak on 09/06/13.
 */
public class Champion {
    private static final File default_picture = new File(SoftwareProperties.DEFAULT_ICON_PATH);
    private String name;
    private File picture;
    private int number;
    private ArrayList<Skill> skillList;

    public Champion (String name, File picture, int number, ArrayList<Skill> skillList){
        super();
        this.name = name;
        this.picture = picture;
        this.number = number;
        this.skillList = skillList;
    }

    public Champion (String name, String picture, int number, ArrayList<Skill> skillList){
        super();
        this.name = name;
        this.picture = new File(picture);
        this.number = number;
        this.skillList = skillList;
    }

    public Champion (String name){
        super();
        this.name = name;
        this.picture = null;
        this.number = -1;
        this.skillList = null;
    }

    public Champion (String name, int number, ArrayList<Skill> skillList){
        super();
        this.name = name;
        this.number = number;
        this.picture = retrivePicture(number);
        this.skillList = skillList;
    }

    public String getName(){
        return this.name;
    }

    public void setName(String name){
        this.name = name;
    }

    public File getPicture(){
        if (picture!=null) {
            return picture;
        } else {
            return default_picture;
        }
    }

    public void setPicture(File picture){
        this.picture = picture;
    }

    public void setPicture(String picture){
        this.picture = new File(picture);
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public ArrayList<Skill> getSkillList() {
        return skillList;
    }

    public void setSkillList(ArrayList<Skill> skillList) {
        this.skillList = skillList;
    }

    private File retrivePicture(int number){
        //TODO
        return null;
    }
}
